home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 11734 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  899 b 

  1. Path: nntp.teleport.com!usenet
  2. From: GHouck <hksys@teleport.com>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: String Function
  5. Date: 25 Mar 1996 20:04:54 GMT
  6. Organization: systems hk
  7. Message-ID: <4j6u96$3ef@nadine.teleport.com>
  8. References: <4j06mo$1nb@freenet-news.carleton.ca>
  9. NNTP-Posting-Host: ip-pdx04-34.teleport.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.22 (Windows; I; 32bit)
  14.  
  15. aq436@FreeNet.Carleton.CA (Jerry Boyd) wrote:
  16. >
  17. >How would I write a function (in the form of 
  18. >substring[source,start,count,result] ... yes, I need to
  19. >reinvent the wheel) to remove a specified number of 
  20. >characters from a string and store it in an array.  For 
  21. >instance, extracting three characters from a string, 
  22. >starting at from the 4th character.
  23. Jerry,
  24.  
  25. You might try:
  26.  
  27.   strncpy( result,(source+start),count );
  28.  
  29. Yours, Geoff Houck
  30.  
  31.